From 1d14c22b04cec4dd345fbf1c153c452214cf5dc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 9 Jul 2021 06:06:36 +0200 Subject: [PATCH] debian/tests: Port to Gtk4 and run them both in wayland and x11 --- debian/tests/build | 7 ++--- debian/tests/control | 47 ++++++++++++++++++++++++++---- debian/tests/installed-tests | 7 ++--- debian/tests/installed-tests-flaky | 7 +---- debian/tests/python3-gi | 24 ++++++++------- 5 files changed, 59 insertions(+), 33 deletions(-) diff --git a/debian/tests/build b/debian/tests/build index c99c2e4d41..fdfb41d28e 100755 --- a/debian/tests/build +++ b/debian/tests/build @@ -11,10 +11,7 @@ set -e set -u set -x -# We don't test under Wayland yet, because we don't have a Wayland -# equivalent of xvfb-run -export GDK_BACKEND=x11 - +TESTDIR="$PWD/$(dirname $0)" WORKDIR=$(mktemp -d) cleanup () { rm -fr "$WORKDIR" @@ -72,6 +69,6 @@ EOF "${CROSS_COMPILE}gcc" -o gtktest gtktest.c $("${CROSS_COMPILE}pkg-config" --cflags --libs gtk4) echo "build: OK" [ -x gtktest ] -xvfb-run -a -s "-screen 0 1024x768x24" \ +"$TESTDIR"/run-with-display $GDK_BACKEND \ ./gtktest echo "run: OK" diff --git a/debian/tests/control b/debian/tests/control index e535d20f45..649912e7b8 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,16 +1,51 @@ -Tests: build +Test-Command: env GDK_BACKEND=x11 debian/tests/build +Features: test-name=build-x11 +Classes: desktop, x11 Depends: build-essential, libgtk-4-dev, xauth, xvfb Restrictions: allow-stderr, superficial -Tests: python3-gi +Test-Command: env GDK_BACKEND=wayland debian/tests/build +Features: test-name=build-wayland +Classes: desktop, wayland, linux-only +Depends: build-essential, libgtk-4-dev, weston +# Architecture: linux-any +Restrictions: allow-stderr, superficial + +Test-Command: env GDK_BACKEND=x11 debian/tests/python3-gi +Features: test-name=python3-gi-x11 +Classes: desktop, x11 Depends: dbus, gir1.2-gtk-4.0, python3-gi (>= 3.40), xauth, xvfb -# https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/81, !145, etc. -Restrictions: flaky, superficial +Restrictions: superficial -Tests: installed-tests +Test-Command: env GDK_BACKEND=wayland debian/tests/python3-gi +Features: test-name=python3-gi-wayland +Classes: desktop, wayland, linux-only +Depends: dbus, gir1.2-gtk-4.0, libgl1, libgl1-mesa-dri, python3-gi (>= 3.40), weston +# Architecture: linux-any +Restrictions: superficial + +Test-Command: env GDK_BACKEND=x11 debian/tests/installed-tests +Features: test-name=installed-tests-x11 +Classes: desktop, x11 Depends: dbus (>= 1.8), fonts-dejavu-core, gnome-desktop-testing (>= 2018.1-1~), gtk-4-tests, locales | locales-all, ttf-bitstream-vera, xauth, xvfb Restrictions: allow-stderr -Tests: installed-tests-flaky +Test-Command: env GDK_BACKEND=wayland debian/tests/installed-tests +Features: test-name=installed-tests-wayland +Classes: desktop, wayland, linux-only +Depends: dbus (>= 1.8), fonts-dejavu-core, gnome-desktop-testing (>= 2018.1-1~), gtk-4-tests, locales | locales-all, ttf-bitstream-vera, weston +# Architecture: linux-any +Restrictions: allow-stderr + +Test-Command: env GDK_BACKEND=x11 debian/tests/installed-tests-flaky +Features: test-name=installed-tests-flaky-x11 +Classes: desktop, x11 Depends: dbus (>= 1.8), fonts-dejavu-core, gnome-desktop-testing (>= 2018.1-1~), gtk-4-tests, locales | locales-all, ttf-bitstream-vera, xauth, xvfb Restrictions: allow-stderr, flaky + +Test-Command: env GDK_BACKEND=wayland debian/tests/installed-tests-flaky +Features: test-name=installed-tests-flacky-wayland +Classes: desktop, wayland, linux-only +Depends: dbus (>= 1.8), fonts-dejavu-core, gnome-desktop-testing (>= 2018.1-1~), gtk-4-tests, locales | locales-all, ttf-bitstream-vera, weston +# Architecture: linux-any +Restrictions: allow-stderr, flaky diff --git a/debian/tests/installed-tests b/debian/tests/installed-tests index fcffbf9d5e..dac000d133 100755 --- a/debian/tests/installed-tests +++ b/debian/tests/installed-tests @@ -10,17 +10,14 @@ export GIO_USE_VFS=local export GIO_USE_VOLUME_MONITOR=unix export XDG_RUNTIME_DIR="$AUTOPKGTEST_TMP" - -# We don't test under Wayland yet, because we don't have a Wayland -# equivalent of xvfb-run -export GDK_BACKEND=x11 +export HOME="$AUTOPKGTEST_TMP" tests=$(gnome-desktop-testing-runner -l gtk-4.0 | cut -f1 -d' ' | grep -v '^gtk-4.0/gtk/templates.test$') exec dbus-run-session -- \ -xvfb-run -a -s "-screen 0 1024x768x24" \ +debian/tests/run-with-display $GDK_BACKEND \ debian/tests/run-with-locales \ --generate de_DE.UTF-8 \ --generate en_GB.UTF-8 \ diff --git a/debian/tests/installed-tests-flaky b/debian/tests/installed-tests-flaky index f092c982ea..47b39cc179 100755 --- a/debian/tests/installed-tests-flaky +++ b/debian/tests/installed-tests-flaky @@ -11,19 +11,14 @@ export GIO_USE_VOLUME_MONITOR=unix export XDG_RUNTIME_DIR="$AUTOPKGTEST_TMP" -# We don't test under Wayland yet, because we don't have a Wayland -# equivalent of xvfb-run -export GDK_BACKEND=x11 - exec dbus-run-session -- \ -xvfb-run -a -s "-screen 0 1024x768x24" \ debian/tests/run-with-locales \ --generate de_DE.UTF-8 \ --generate en_GB.UTF-8 \ --generate en_US.UTF-8 \ --generate sv_SE \ -- \ -xvfb-run -a -s "-screen 0 1024x768x24" \ +debian/tests/run-with-display $GDK_BACKEND \ gnome-desktop-testing-runner \ --report-directory="$AUTOPKGTEST_ARTIFACTS" \ --tap \ diff --git a/debian/tests/python3-gi b/debian/tests/python3-gi index 437346d6ba..2fc1ad8fc4 100755 --- a/debian/tests/python3-gi +++ b/debian/tests/python3-gi @@ -1,22 +1,24 @@ #!/bin/sh -# We don't test under Wayland yet, because we don't have a Wayland -# equivalent of xvfb-run -export GDK_BACKEND=x11 - -xvfb-run -a -s "-screen 0 1024x768x24" \ +debian/tests/run-with-display $GDK_BACKEND \ +dbus-run-session \ python3 <